import traceback
from django.core.management.base import BaseCommand
import logging
from apps.news.models import Record

class Command(BaseCommand):
    def handle(self, *args, **options):
        self.logger = logging.getLogger()
        try:
            records = Record.objects.all()
            for record in records:
                record._compile_story()
        except Exception, e:
            self.logger.error(traceback.format_exc())
        
